package com.dongliu.service;

import com.dongliu.domain.Admin;
import com.dongliu.domain.User;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
public interface UserService {
    /**
     * 保存
     * @param user
     * @return
     */
    public boolean save(User user);

    /**
     * 修改
     * @param user
     * @return
     */
    public boolean update(User user);

    public boolean updateById(User user);

    /**
     * 按id删除
     * @param username
     * @return
     */
    public boolean delete(String username);
    /**
     * 按username查询
     * @param username
     * @return
     */
    public User getByUsername(String username);
    public User getById(Integer id);

    /**
     * 查询所有
     * @return
     */
    public List<User> getAll();
    public int getCount();
    public User login(String username, String password);
}
